Release 10.1A: OpenEdge Development:
Progress 4GL Reference


FIND-CURRENT( ) method

Changes the lock mode of a record in a buffer.

Return type: LOGICAL

Applies to: Buffer object handle

Syntax
FIND-CURRENT ( [ lockmode [ , wait-mode ] ] ) 

lockmode

An integer expression evaluating to one of the following constants: SHARE-LOCK, EXCLUSIVE-LOCK, or NO-LOCK. You can assign any of these constants to an integer variable. For example, mylock = NO-LOCK. The default is SHARE-LOCK.

waitmode

An integer expression evaluating to one of the following: NO-WAIT, 0, or the Unknown value (?). You can assign NO-WAIT to an integer variable. For example, mywait = NO-WAIT.

The default is to wait.

The following shows an example of the FIND-CURRENT method:

DEFINE VARIABLE bh AS HANDLE. 
bh = BUFFER customer:HANDLE. 
DO Transaction: 
	bh:FIND-CURRENT(EXCLUSIVE-LOCK). 
END. 
	MESSAGE bh:CURRENT-CHANGED cust.cust-num. 

If the change in lock status succeeds, the method returns TRUE, otherwise it returns FALSE.

If the lock change fails, a message displays. You can suppress the message using NO-ERROR on the statement containing the method.

Executing the FIND-CURRENT method resets the CURRENT-CHANGED attribute. If the record in the database changes between the time the original record was found and the FIND-CURRENT executes, the CURRENT-CHANGED attribute returns TRUE. If the record does not change, then the CURRENT-CHANGED attribute returns FALSE.

See also

FIND-BY-ROWID( ) method, CURRENT-CHANGED attribute, CURRENT-CHANGED function, FIND-FIRST( ) method, FIND-LAST( ) method, FIND-UNIQUE( ) method, FIND statement


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095